package chapter05;

public class java04_Object_test {
    public static void main(String[] args) {
        // TODO 常见类和对象
        // 数组

        int[] nums = { 1, 4, 3, 2, 5 };
        for ( int j = 0; j < nums.length; j++) {
            for (int i = 0; i < nums.length -j - 1; i++) {
                int num1 = nums[i];
                int num2 = nums[i+1];
                if (num1 > num2){
                    nums[i+1] = num1;
                    nums[i] = num2;
                }
            }
        }


        for ( int num : nums){
            System.out.println(num);
        }
    }
}
